import request from '@/utils/request'

const project = {
  // 科技平台列表
  list(params) {
    return request.get('/tjpt/platformInfo/list',{params});
  },
  // 新增科技平台基本信息
  add(data) {
    return request.post('/tjpt/platformInfo/add', data);
  },
  edit(data) {
    return request.post('/tjpt/platformInfo/update', data);
  },
  delete(id) {
    return request.post(`/tjpt/platformInfo/delete/${id}`);
  },
  get(id) {
    return request.get(`/tjpt/platformInfo/detail/${id}`);
  },
  getAll(id) {
    return request.get(`/tjpt/platformInfo/allDetail/${id}`);
    // return request.get(`/tjpt/platformInfo/detail/${id}`);
  },
  // 我的科技平台列表
  myList(params){
    return request.get(`/tjpt/platformInfo/myList`,{params});
  },


  // 新增建设单位信息
  constructionUnitAdd(data){
    return request.post('/tjpt/constructionUnit/add', data);
  },
  constructionUnitUpdate(data){
    return request.post('/tjpt/constructionUnit/update', data);
  },
  // 获取建设单位信息详情
  constructionUnitDetail(id){
    return request.get(`/tjpt/constructionUnit/detail/${id}`);
  },
  // 新增立项背景与意义信息
  platformBackgroundAdd(data){
    return request.post('/tjpt/platformBackground/add', data);
  },
  platformBackgroundUpdate(data){
    return request.post('/tjpt/platformBackground/update', data);
  },
  // 获取立项背景与意义信息详情
  platformBackgroundDetail(id){
    return request.get(`/tjpt/platformBackground/detail/${id}`);
  },

  // 新增主要任务信息
  platformMainTaskAdd(data){
    return request.post('/tjpt/platformMainTask/add', data);
  },
  platformMainTaskUpdate(data){
    return request.post('/tjpt/platformMainTask/update', data);
  },
  // 获取主要任务信息
  platformMainTaskDetail(id){
    return request.get(`/tjpt/platformMainTask/detail/${id}`);
  },
  // 新增经费预算信息
  platformBudgetAdd(data){
    return request.post('/tjpt/platformBudget/add', data);
  },
  platformBudgetUpdate(data){
    return request.post('/tjpt/platformBudget/update', data);
  },
  // 获取经费预算信息详情
  platformBudgetDetail(id){
    return request.get(`/tjpt/platformBudget/detail/${id}`);
  },
  getBudgetByPlatformId(id){
    return request.get(`/tjpt/platformBudget/getByPlatformId/${id}`);
  },
  // 新增（修改）仪器设备经费概算信息
  platformEquipmentAddList(data){
    return request.post('/tjpt/platformEquipment/addList', data);
  },
  // 根据科技平台id获取仪器设备经费概算信息详情
  getByPlatformId(id){
    return request.get(`/tjpt/platformEquipment/getByPlatformId/${id}`);
  },

  // 新增建设单位的保障条件与经费配套信息
  platformSafeguardAdd(data){
    return request.post('/tjpt/platformSafeguard/add', data);
  },
  platformSafeguardUpdate(data){
    return request.post('/tjpt/platformSafeguard/update', data);
  },
  // 获取建设单位的保障条件与经费配套信息详情
  platformSafeguardDetail(id){
    return request.get(`/tjpt/platformSafeguard/detail/${id}`);
  },
  getSafeguardByPlatformId(id){
    return request.get(`/tjpt/platformSafeguard/getByPlatformId/${id}`);
  },
  // 新增（修改）委员会人员信息
  platformMemberAdd(data){
    return request.post('/tjpt/platformMember/addList', data);
  },
  platformMemberUpdate(data){
    return request.post('/tjpt/platformMember/update', data);
  },
  platformMemberDelete(id){
    return request.post(`/tjpt/platformMember/delete/${id}`);
  },
  getPlatformMemberByType(id,type){
    return request.get(`/tjpt/platformMember/getByPlatformIdAndType/${id}/${type}`);
  },
  getPlatformMember(id){
    return request.get(`/tjpt/platformMember/getByPlatformId/${id}`);
  },








  // 平台类别树
  platformCategoryTree(){
    return request.get(`/tjpt/platformCategory/tree`);
  },
  submit(data){
    return request.post(`/tjpt/platformInfo/submit`, data);
  }

}

export default project;
